<template>
  <div class="hello">
12
 <!--<a href="../../static/data.json"></a>-->
  </div>
</template>

<script>
import axios from 'axios'
export default {
  name: 'HelloWorld',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App'
    }
  }, 
  created () {

 
// this.$http.get('../../static/data.json', function (req, res) { // 注意这里改为post就可以了
//res.json({
//  errno: 0,
//  data: foods
//});
//})
// 
 
//  this.$http.get('../../static/data.json').then((response) => {
// 	     var appData=response.bodyText;
//       var jsonObj1 = JSON.parse(appData);  //使用JSON.parse() 将JSON字符串转为JS对象;
//	       console.log(jsonObj1.goods);
//
// })


axios.get('../../static/data.json')
  .then(function (response) {
  	var sfcomm=response.data;
  	
  	var agoods=sfcomm.goods;
  	var aratings=sfcomm.ratings;
  	var aseller=sfcomm.seller;
  	console.log(sfcomm);
    console.log(agoods);
    console.log(aratings);
    console.log(aseller);
   
  })
  .catch(function (error) {
    console.log(error);
  });

 
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less"  scoped>

</style>
